<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0">
    <title>简历</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f0f8ff;
            margin: 0;
            padding: 20px;
        }
        .container {
            max-width: 500px;
            margin: 0 auto;
            padding: 20px;
            background-color: #fff;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        .input-group {
            margin-bottom: 10px;
        }
        .input-group label {
            display: block;
            margin-bottom: 6px;
        }
        .input-group input[type="text"] {
            width: 100%;
            padding: 8px;
            box-sizing: border-box;
        }
        .buttons {
            display: flex;
            gap: 10px;
        }
        .buttons button {
            padding: 10px 20px;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>简历</h1>
        <div class="input-group">
            <label for="requiredInput">必填文本框:</label>
            <input type="text" id="requiredInput" placeholder="必填">
        </div>
        <div class="input-group">
            <label for="optionalInput">可选文本框:</label>
            <td onmousedown="alert('只能选择男女');" title="只能选择男女">
            <input type="radio" name="sex" />男&nbsp;&nbsp;&nbsp;<input type="radio" name="sex" checked="checked" />女
            </td>
        </div>
        <div class="buttons">
            <button type="button" id="submitButton">提交</button>
            <button type="button" id="resetButton">重置</button>
        </div>
    </div>
 
    <script>
        alert('欢迎来到我的简历');
        prompt('请输入姓名','例如张三');
            submitButton.addEventListener('click', function() {
                const inputValue = requiredInput.value.trim();
                if (inputValue.length < 8) {alert('至少8个字符');} 
                else {alert('提交成功');}
            });
            document.getElementById('resetButton').addEventListener('click', function() {
                requiredInput.value = '必填';
                requiredInput.style.color = '#ccc';
                document.getElementById('optionalInput').value = '';
            });
    </script>
</body>
</html>